package com.mini.game.api;
import com.mini.common.vo.ReqData;
import com.mini.common.vo.ResData;
import com.mini.game.auth.ThreadLocalUserContext;
import com.mini.game.bus.userdata.GameUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小鱼儿
 * @date 2020/11/16 18:29
 */
@RestController
@RequestMapping(value = "/api")
public class ApiController {
    @Autowired
    private GameUserService gameUserService;

    @RequestMapping(value = "/login")
    public ResData login(@RequestBody ReqData reqData) {
        return gameUserService.login(ThreadLocalUserContext.getUserId(), reqData.getData());
    }
}
